<%str_method = @route.id.nil? ?  'post' : 'put'%>
<%str_path = @route.id.nil? ? routes_path : route_path%>

<%= form_for(@route, :url=> str_path, :method=>str_method,:html=>{:id=>"form_station"}) do |f| %>
  <% if @route.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@promo.errors.count, "error") %> prohibited this station from being saved:</h2>

      <ul>
      <% @route.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

	<%= field_set_tag text="Información de la ruta", :class => "MiFieldSet1" do%>
		<div class="field">
		  <%= f.label "Nombre" %><br />
		  <%= f.text_field :nombre, :class => "MiTextField1" %>
		</div>
		<div class="field">
		  <%= f.label "Distancia (km)" %><br />
		  <%= f.text_field :distancia, :class => "MiTextField1" %>
		</div>
		<% for i in 1..5 %>
			<div class="field">
				  <%= label_tag "Terminal #{i}" %><br />
					<%= select_tag "terms[t#{i}]", options_from_collection_for_select(@stations, :id, :ciudad), :class => "MiComboBox1", :include_blank=>"Elija una terminal" %><br />
			</div>
		<% end %>
		<div class="actions">
			<% if @route.id.nil? then %>
				<%= f.submit "Registrar", :class => "MiBoton1", :style => "margin-right: 5px; margin-bottom: 5px; padding-left: 0px; margin-top: 10px;" %>
			<% else %>
				<%= f.submit "Guardar", :class => "MiBoton1", :style => "margin-right: 5px; margin-bottom: 5px; padding-left: 0px; margin-top: 10px;" %>
			<% end %>
		</div>
	<% end %>

<% end %>
